import fetch from 'common/src/utils/fetch'



/**
 *添加限制学生
 */
function add(data) {
    return fetch({
        url: '/api/electionservice/elcStudentLimit/add',
        method: 'post',
        data:data
    });
}

/**
 *删除
 */
function deleteLimit(data) {
    return fetch({
        url: '/api/electionservice/elcStudentLimit/delete',
        method: 'post',
        data:data
    });
}

/**
 *删除所有
 */
function deleteAll(data) {
    return fetch({
        url: '/api/electionservice/elcStudentLimit/deleteAll',
        method: 'post',
        data:data
    });
}

/**
 *删除所有
 */
function update(data) {
    return fetch({
        url: '/api/electionservice/elcStudentLimit/update',
        method: 'post',
        data:data
    });
}

function getElcStudentLimit(calendarId,id) {
    return fetch({
        url: '/api/electionservice/elcStudentLimit/getElcStudentLimit?calendarId='+calendarId+'&id='+id,
        method: 'get',
    });
}

function exportList(data) {
    return fetch({
        url: '/api/electionservice/elcStudentLimit/export',
        method: 'post',
        data: data
    });
}

function exportUnLimit(data) {
    return fetch({
        url: '/api/electionservice/elcStudentLimit/exportUnLimit',
        method: 'post',
        data: data
    });
}

function getResultByKey(key) {
    return fetch({
        url: '/api/electionservice/elcStudentLimit/result/'+key,
        method: 'get',
    });
}

function getStudentByCode(studentId){
    return fetch({
        method: 'post',
        url: '/api/electionservice/elcStudentLimit/getUnLimitStudents',
        data: {
            pageNum_: 1,
            pageSize_: 10,
            condition: {studentId: studentId}
        }
    })
}

export default {
    "add": add,
    "deleteLimit":deleteLimit,
    "deleteAll":deleteAll,
    "update":update,
    "getElcStudentLimit":getElcStudentLimit,
    "exportList":exportList,
    "getResultByKey": getResultByKey,
    "exportUnLimit": exportUnLimit,
    "getStudentByCode": getStudentByCode
}



